import { defineClientAppEnhance } from '@vuepress/client'
// @ts-ignore
import DemoBlock from '../../vue/tpl/demo-block.vue'
import { getCompList } from '../../vue/temp/importCompList.js'

export default defineClientAppEnhance(({ app, router, siteData }) => {
  app.component('demo-block', DemoBlock)
  // 组件列表
  let arr = getCompList()
  for (const compInfo of arr) {
    if (compInfo['isInstall']) {
      app.use(compInfo['item'])
    } else {
      app.component(compInfo['name'], compInfo['item'])
    }
  }
})
